import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * Created by dllo on 18/5/10.
 */
@WebServlet(name = "AServlet",urlPatterns = "/a")
public class AServlet extends HttpServlet {

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

        response.addHeader("content-type","text/html;charset=utf-8");

        response.setHeader("Refresh","5;URL=/down");

        response.getWriter().println("<a href=\"/down\">5秒后下载,如果不下载,点此链接</a>");
    }
}
